package com.example.rbac.entity.defefult;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by Administrator on 2017/9/10.
 */
@Data
@ToString
public class DateDefult implements Serializable{

    @Id
    private String id;
    private Date updateTime;
    private Date createTime;
    private String state;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getCreateTime() {
        return createTime;
    }


    public DateDefult(){
        if (this.createTime == null)
            this.createTime = new Date();
        if (this.updateTime == null)
            this.updateTime = new Date();
    }
}
